<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>距离9月30日下午4点42分的倒计时</title>
    <style>
        @import url('https://fonts.googleapis.com/css2?family=Roboto+Mono:wght@400;700&display=swap');

        body {
            margin: 0;
            font-family: 'Roboto Mono', monospace;
            color: white;
            background: linear-gradient(-45deg, #ee7752, #e73c7e, #23a6d5, #23d5ab);
            background-size: 400% 400%;
            animation: gradientBG 15s ease infinite;
            display: flex;
            justify-content: center;
            align-items: center;
            min-height: 100vh;
            text-align: center;
        }

        @keyframes gradientBG {
            0% { background-position: 0% 50%; }
            50% { background-position: 100% 50%; }
            100% { background-position: 0% 50%; }
        }

        .container {
            background: rgba(0, 0, 0, 0.25);
            padding: 40px 60px;
            border-radius: 20px;
            box-shadow: 0 10px 30px rgba(0,0,0,0.2);
            backdrop-filter: blur(10px);
            border: 1px solid rgba(255, 255, 255, 0.1);
        }

        h1 {
            font-size: 2.5em;
            margin-bottom: 10px;
            font-weight: 700;
        }

        p {
            font-size: 1.2em;
            margin-bottom: 30px;
            opacity: 0.9;
        }

        #countdown {
            display: flex;
            justify-content: center;
            gap: 20px;
        }

        .time-box {
            display: flex;
            flex-direction: column;
            align-items: center;
        }

        .time-box .number {
            font-size: 4em;
            font-weight: 700;
            line-height: 1;
        }

        .time-box .label {
            font-size: 1em;
            text-transform: uppercase;
            opacity: 0.8;
            margin-top: 10px;
        }
        
        #message {
            display: none; /* 默认隐藏 */
            font-size: 3em;
            font-weight: bold;
        }

    </style>
</head>
<body>

    <div class="container">
        <h1>倒计时</h1>
        <p>距离 2025年9月30日 16:42:00</p>
        <div id="countdown">
            <div class="time-box">
                <span class="number" id="days">00</span>
                <span class="label">天</span>
            </div>
            <div class="time-box">
                <span class="number" id="hours">00</span>
                <span class="label">小时</span>
            </div>
            <div class="time-box">
                <span class="number" id="minutes">00</span>
                <span class="label">分钟</span>
            </div>
            <div class="time-box">
                <span class="number" id="seconds">00</span>
                <span class="label">秒</span>
            </div>
        </div>
        <div id="message">
            🎉 时间到！🎉
        </div>
    </div>

    <script>
        // 设置目标日期和时间
        // 注意：月份是从0开始的，所以9月是8
        const targetDate = new Date(2025, 8, 30, 16, 42, 0).getTime();

        const countdownElement = document.getElementById('countdown');
        const messageElement = document.getElementById('message');
        const daysEl = document.getElementById('days');
        const hoursEl = document.getElementById('hours');
        const minutesEl = document.getElementById('minutes');
        const secondsEl = document.getElementById('seconds');

        // 每秒更新一次计时器
        const interval = setInterval(() => {
            const now = new Date().getTime();
            const distance = targetDate - now;

            if (distance < 0) {
                clearInterval(interval);
                countdownElement.style.display = 'none';
                messageElement.style.display = 'block';
                return;
            }

            const days = Math.floor(distance / (1000 * 60 * 60 * 24));
            const hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
            const minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
            const seconds = Math.floor((distance % (1000 * 60)) / 1000);
            
            // 为了美观，个位数前面补0
            daysEl.innerText = String(days).padStart(2, '0');
            hoursEl.innerText = String(hours).padStart(2, '0');
            minutesEl.innerText = String(minutes).padStart(2, '0');
            secondsEl.innerText = String(seconds).padStart(2, '0');

        }, 1000);
    </script>

</body>
</html>